import { PrefabPath } from "../config/PrefabPath";
import MusicManager from "../core/managers/MusicManager";
import UIManager from "../core/managers/UIManager";


const { ccclass, property } = cc._decorator;
@ccclass
export default class MainScene extends cc.Component {
    @property({ type: cc.Node, tooltip: '全屏视图层级' })
    panelLayer: cc.Node = null;

    @property({ type: cc.Node, tooltip: '弹窗面板层级' })
    dialogLayer: cc.Node = null;

    @property({ type: cc.Node, tooltip: 'tips提示层级' })
    toastLayer: cc.Node = null;

    @property({ type: cc.Node, tooltip: '加载loading层级' })
    loadingLayer: cc.Node = null;


    @property({ type: cc.Node, tooltip: '新手引导层级' })
    guideLayer: cc.Node = null;


    @property({ type: cc.AudioClip, tooltip: '背景音乐' })
    bgMusic: cc.AudioClip = null;

    onLoad() {
        this.init();
        this.initConfigs();
    }
    init() {
        UIManager.dialogContainer = this.dialogLayer;
        UIManager.layerContainer = this.panelLayer;
        UIManager.toastContainer = this.toastLayer;
        UIManager.loadingContainer = this.loadingLayer;
        UIManager.guideContainer = this.guideLayer;

        UIManager.show(PrefabPath.gameMainLayer);
        MusicManager.playMusic(this.bgMusic);
    }
    initConfigs() {

    }
    initEvent() {

    }

}